-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: benchmarks: power_consumption: i2c: Fix increased power consumpion #19861
tests: benchmarks: power_consumption: i2c: Fix increased power consumpion #19861
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 7ab054fd8cc3914d7c060c992b06249cc5d4edd2 more detailssdk-nrf:
Github labels
List of changed files detected by CI (3)
Outputs:ToolchainVersion: 11349092be Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
@@ -12,6 +12,16 @@ const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led2), gpios); | |||
static bool state = true; | |||
extern void thread_definition(void); | |||
|
|||
/* Some tests requires that test thread controls when the moment when it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests require that test thread controls when it is suspended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
75d72ad
to
7ab054f
Compare
Test was suspending test thread from the timer interrupt at random (but periodic) point. Some drivers which are tested in that framework handles power management in the thread context. Randomly suspending the test thread could lead to a case where driver did not finish requested operation and system goes to s2ram in the middle of the driver operation. Extending the test framework to allow more controlled thread suspension. Timer can indicate to the thread that is shall be suspended and thread calls self suspension when ready. Signed-off-by: Krzysztof Chruściński <[email protected]>
Test thread cannot be suspended at any time because driver power management happens in the thread context so if thread is suspended at the random moment and system goes to s2ram it can lead to increased power consumption because thread got suspended before i2c device got properly suspended. Signed-off-by: Krzysztof Chruściński <[email protected]>
Add property to enable runtime PM for i2c and spi used for controlling the sensor. Signed-off-by: Krzysztof Chruściński <[email protected]>
Test was suspending test thread from the timer interrupt at random (but periodic) point. I2c driver handles power management in the thread context. Randomly suspending the test thread could lead to a case where driver did not finish requested operation and system goes to s2ram in the middle of the driver operation.
PR extends framework to allow optional requesting of the test thread suspension (instead of forcing) and test thread suspends itself when requested. It is done after driver operation is finished.
Additionally, added enabling of the runtime power management to the i2c instance used by the shield used in the test.